Add command palette trigger button to admin bar (Left-aligned search bar version)#11108
Add command palette trigger button to admin bar (Left-aligned search bar version)#11108t-hamano wants to merge 1 commit intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
In my opinion, we should move ahead with whatever we have now for Beta 3, even if there's still design changes needed. We can always do some CSS tweaks in follow-ups and have people attempt to centre it, and at least the main functionality is in. |
I agree. If we start small, I think a button would have less impact than a search bar. What do you think? |
| 'href' => '#', | ||
| 'meta' => array( | ||
| 'class' => 'hide-if-no-js', | ||
| 'onclick' => 'wp.data.dispatch( "core/commands" ).open(); return false;', |
There was a problem hiding this comment.
I assume return false is the preventDefault signal. If so, can we comment to make it clear?
There was a problem hiding this comment.
A behaviour I'm noticing:
- Go to a WP-Admin that's taller than the viewport (e.g. Themes, User > Profile)
- Click on the element to bring up the search bar/dialog
- Click anywhere else to dismiss it
- Observed: browser scrolls to bottom
| return; | ||
| } | ||
|
|
||
| $is_apple_os = (bool) preg_match( '/Macintosh|Mac OS X|Mac_PowerPC/i', $_SERVER['HTTP_USER_AGENT'] ?? '' ); |
There was a problem hiding this comment.
Where was this pattern sourced? From WP itself? I'm trying to determine how reliable it is and whether the source should be cited.
| } | ||
|
|
||
| #wpadminbar #wp-admin-bar-command-palette .ab-item { | ||
| width: 200px; |
There was a problem hiding this comment.
Given the layout constraints (use of floats, etc.) of the admin bar, what would it take to achieve a button that tries to take up 443px unless there isn't enough room for other items?
Trac ticket: https://core.trac.wordpress.org/ticket/64672
Use of AI Tools
None
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.